Thanks to NetworkManager's connection name disambiguation, it's
pretty common for single wired connections to be named "Wired". This
is fine and what we want almost all times, but in the specific case
of quick settings, we already have a "Wired" string set as title of
the quick settings toggle, so having that as subtitle is reduntant.
Hide the subtitle label (by returning null) when the subtitle of
a wired network matches the title.
status/network: Title mobile connections as "Mobile"
As per the latest mockups, modem network connections are labeled
"Mobile". Override _getDefaultName in NMModemToggle and always
return "Mobile" as title.
status/network: Title bluetooth connections as "Tether"
As per the latest mockups, Bluetooth network connections are simply
labeled "Tether". Override _getDefaultName in NMBluetoothToggle
and always return "Tether" as title.
If there is a single connection for a given NMToggle subclass,
use the connection name; otherwise, transform that into '%d
connected'. This is better than the current "Device (counter)"
template, e.g. "VPN (2)", which would give us a quick toggle
with:
Following the previous commits where we left the quick toggle title
open for the new title scheme, set the titles for all network pills
to what currently is the "default" name.
That means, we pull the device name from Network Manager for devices,
through the disambiguate function, and hardcode 'VPN' for VPN
connections.
status/powerProfiles: Set profile name as subtitle
Just like with network names, set the name of the power profile as
the subtitle of the quick settings pill. This allows more of the
power profile name to be visible, and reduces chances of ellipsing
the name.
Rename the 'title' variable to 'name', to be more semantic and
better represent what it is now.
We'll soon add a subtitle, so rename the label property to something
that is a bit more semantic.Add a warning when trying to set the old
'label' property.
Florian Müllner [Tue, 22 Nov 2022 18:40:37 +0000 (19:40 +0100)]
extension-tool: Fix falling back to GSettings
When we switched the tool to the public Extensions service, the
fallback to GSettings broke in the case GNOME is installed but
not running (because the service can be autostarted, albeit it'll
fail later).
Fix this by also falling back when we don't get a response from
gnome-shell.
Florian Müllner [Thu, 2 Feb 2023 22:37:21 +0000 (23:37 +0100)]
croco: Use g_string_free() return value
glib now warns if the return value is not used, so use the API as
intended instead of assigning the character data separately before
freeing the GString.
Florian Müllner [Thu, 26 Jan 2023 02:36:03 +0000 (03:36 +0100)]
st/texture-cache: Port to StIconTheme
It's finally time to pull the switch and replace GtkIconTheme with
out modified copy. This removes another Gtk dependency that ties
us to the old Gtk3.
Florian Müllner [Wed, 25 Jan 2023 18:29:25 +0000 (19:29 +0100)]
st/icon-theme: Stop using GdkRGBA for coloring symbolics
We already have ClutterColor to represent a color, and StIconColors
to hold color information for symbolics from CSS. Now that we moved
GtkIconTheme in-tree, we can make use of those types instead of
translating back and forth from GdkRGBA.
Florian Müllner [Wed, 1 Feb 2023 15:10:28 +0000 (16:10 +0100)]
st/icon-theme: Use standard GObject macros
The GTK code predates the G_DECLARE_*() macros, so it's under- standable
that it still does all the boilerplate manually. We
don't have that excuse in 2023, so move the the standard macros.
There is no reason for GtkIconTheme to be derivable, and as that
means that the instance struct itself is private, stop adding
separate private instance data.
Florian Müllner [Wed, 1 Feb 2023 14:24:09 +0000 (15:24 +0100)]
st/icon-theme: Replace GTK's custom i18n support
GTK uses its own private i18n header, which most notably defines
an I_() macro for interning static strings. That may be a worthwhile
idea for the entire codebase, but as it's out of scope for this
change set, just use the standard i18n support from glib for now.
Those are GTK internals that don't apply to us. Without the distinct
"screen's default icon theme", we also don't need custom theme support,
and can just always track the theme from StSettings.
Florian Müllner [Thu, 26 Jan 2023 00:41:32 +0000 (01:41 +0100)]
st/icon-theme: Remove Win32 compatibility
gnome-shell does not run on Windows, and if someone was crazy enough
to try to make it work, the icon theme support would be the least
of their worries.
Florian Müllner [Thu, 26 Jan 2023 02:32:52 +0000 (03:32 +0100)]
st/icon-theme: Standard types
The GTK code dates back to a time when "gchar" and friends were
still considered a good idea. Replace them with standard types
except for "guint" (I'm lazy) and GtkIconCache code that relies
on glib's byte order macros.
Florian Müllner [Wed, 1 Feb 2023 15:57:35 +0000 (16:57 +0100)]
st/icon-theme: Define default icon theme
In GTK, the value comes from another private header. It doesn't
make sense to copy it in its entirety, just define the one value
we actually need ourselves.
Florian Müllner [Wed, 1 Feb 2023 12:21:08 +0000 (13:21 +0100)]
st/icon-theme: Merge private header
GtkIconTheme's headers are split between a public and a private
one. We won't expose the icon theme API at all, nor do we need
to access anything beyond what the texture cache is currently
using, so merge the private header into the implementation.
Florian Müllner [Wed, 1 Feb 2023 14:19:47 +0000 (15:19 +0100)]
st/icon-theme: Copy GdkPixbuf utility code
GTK includes a couple of shared private GdkPixbuf utilities
functions. We don't have a need for sharing that code, just
for the bits that are used by the IconTheme code.
Florian Müllner [Tue, 10 Jan 2023 19:40:21 +0000 (20:40 +0100)]
st/icon-theme: Copy GTK3 code in-tree
GTK4 changed icon loading significantly, it is now closely tied
to snapshots and paintables. This makes a port highly unrealistic,
so to avoid staying stuck on GTK3 forever, copy the relevant code
into the tree.
The code is unmodified except for the include names and replacing
some stray tab indentation. It is still full of GTK internals, so
it will take a while before we can actually build it.
If gnome-disk-utility is not installed on the system, its desktop file is
unavailable, so we can't get the application's name. In this case hide
the launcher button.
Takao Fujiwara [Tue, 31 Jan 2023 08:42:23 +0000 (17:42 +0900)]
inputMethod: Make set_surrounding() send also empty string
Empty surrounding text values needs to be sent to IBus engines
so that the engines know the focus is changed and the values are
updated.
Also InputMethod can forward the "require-surrounding-text" signal
from IBus engine to mutter.
Jonas Dreßler [Fri, 24 Jun 2022 14:02:54 +0000 (16:02 +0200)]
appDisplay: Move findBestPageToAppend() behavior to IconGrid
This behavior makes more sense to have in the iconGrid itself: When a
page is filled up with items, the new item should never go to the start
of the next page, but always to next empty slot.
Jonas Dreßler [Fri, 24 Jun 2022 13:17:51 +0000 (15:17 +0200)]
appDisplay: Fix multi-page dragging behavior in folders
Folders reflow across pages because they don't set
allow_incomplete_pages to true. This means we want the nudging of items
to happen slightly differently when dragging an item across pages:
- When dragging from lower page index to a higher one, always reflow
towards the start of the grid (because there's now an empty slot on the
old page and items on the new page will force-reflow towards that)
- When dragging from a higher page index to a lower one, we can reflow to
the end as we usually do
To archive this, factor out the selection of "reflow direction" into a
separate variable that always defaults to "end" (because empty space is
always at the end of the grid). Set it to "start" when the item created an
empty slot on the current page or (and this is new:) on a previous page in
the folder case.
Jonas Dreßler [Fri, 24 Jun 2022 11:50:42 +0000 (13:50 +0200)]
iconGrid: Also consider left/right empty space as drop targets
Make it a bit easier to drag items to the start of pages by also taking
the left and right empty space into account, instead of considering it
an invalid target.
Jonas Dreßler [Fri, 24 Jun 2022 11:15:41 +0000 (13:15 +0200)]
appDisplay: Consider drag events during page-switching as invalid
While there's an ongoing animation to switch pages, we should ignore all
drag events as those will end up moving the drag item to an unwanted
position.
Jonas Dreßler [Fri, 24 Jun 2022 11:11:31 +0000 (13:11 +0200)]
appDisplay: Consider drop targets on !currentPage as invalid
The iconGrid's getDropTarget() API supports dropping items to adjacent
pages just fine, but in the AppDisplay, we clip the grid and don't show
those adjacent pages. That doesn't stop getDropTarget() from picking
drop targets which are on adjacent pages though, so we need to filter
those out in the layer above.
Jonas Dreßler [Fri, 24 Jun 2022 08:38:44 +0000 (10:38 +0200)]
appDisplay: Get linear index using item instead of page and position
_getLinearPosition() is a function that converts a page and position
index to the "accumulated" index that includes all pages before the
page. The function is used by _addItem() and _moveItem() for getting the
new index of an item inside the _orderedItems array.
Now when passing -1 as position to _addItem() or _moveItem(), this means
the item should be appended to the page. Right now _getLinearPosition()
returns the last item index on the page when passed -1, inserting the
item into _orderedItems at this index will actually not append it, but
insert it between the second last and last item.
To fix it, let's make the whole thing more robust by explicitly passing
an item to _getLinearPosition(). This means we simply no longer have to
assume what "-1" means. Moving the call to _getLinearPosition() to
happen after addItem() and moveItem() ensures that the new item position
is used and not the old one.
This fixes issues where the _orderedItems array gets out of order when
moving or adding items.
Carlos Garnacho [Mon, 31 Oct 2022 12:16:17 +0000 (13:16 +0100)]
windowManager: Drop grab-op-begin signal connection
This is done just to "reset" the gesture when a grab operation
begins. With grab ops being based on ClutterGrab now, the gesture
will be implicitly reset when these happen. This is unnecessary now.
Carlos Garnacho [Mon, 31 Oct 2022 12:15:32 +0000 (13:15 +0100)]
swipeTracker: Drop grab-op-begin signal connection
This is done just to "reset" the gesture when a grab operation
begins. With grab ops being based on ClutterGrab now, the gesture
will be implicitly reset when these happen. This is unnecessary now.
Carlos Garnacho [Mon, 31 Oct 2022 12:14:10 +0000 (13:14 +0100)]
edgeDragAction: Drop grab-op-begin signal connection
This is done just to "reset" the gesture when a grab operation
begins. With grab ops being based on ClutterGrab now, the gesture
will be implicitly reset when these happen. This is unnecessary now.
Carlos Garnacho [Mon, 31 Oct 2022 12:11:21 +0000 (13:11 +0100)]
backgroundMenu: Drop grab-op-begin signal connection
This is done just to "reset" the click action when a grab operation
begins. With grab ops being based on ClutterGrab now, the action
will be implicitly reset when these happen. This is unnecessary now.
Since the window menu no longer uses a MetaDisplay grab, but directly
a ClutterGrab, this is ineffective. But also, grabs are stackable, so
it's fine to push the window operation grab first and then dismiss the
window menu grab, even when MetaDisplay grabs get ported to using
ClutterGrab underneath. We now can just grab right away, so do that.
Florian Müllner [Fri, 27 Jan 2023 20:06:28 +0000 (21:06 +0100)]
schemas: Consistently use child schemas
Currently only the org.gnome.shell.keybindings schema is marked
as child schema. There's no harm with that, it's just nice to be
consistent, and having schemas show up in `gsettings list-children`
is a nice, touch.
Florian Müllner [Mon, 12 Dec 2022 17:28:04 +0000 (18:28 +0100)]
Revert "status/volume: Clear device menus when unsetting stream"
Device additions/removals are tracked by GvcMixerControl, which
doesn't change when unsetting the stream. So clearing the menu
manually was a workaround, not a fix.
It's also worth noting that I failed to reproduce the original
issue again, so it's possible that we were working around a
pipewire bug that has since been fixed.
Florian Müllner [Tue, 24 Jan 2023 16:49:24 +0000 (17:49 +0100)]
osk-layouts: Replace "SS" extra key with "ẞ"
The on-screen keyboard only handles a single keyval per key, so the
current upper-case version of the German "ß" ends up as "S" instead
of the expected "SS".
It is possible to change the keyboard code to emulate multiple key
presses/releases for that particular case, but then luckily a proper
upper-case form exists nowadays: "ẞ".
That seems more appropriate for a single key than a dedicated "SS"
key, so replace it in all layouts that include it. Anybody who prefers
the traditional "SS" can easily tap "S" twice.
Alessandro Bono [Wed, 3 Aug 2022 13:08:07 +0000 (15:08 +0200)]
gdmUtil: Collect services that determine the username in one place
Doing so, extensions don't need to reimplement entirely the
AuthPrompt.reset() function just for adding their own credential
service in the foreground service check.
Alessandro Bono [Sat, 14 Jan 2023 16:00:42 +0000 (17:00 +0100)]
dash: Connect before destroying
Since commit 7bd98f3f5fb7e0d1220646b8a4ee7073534a8e8f animateOutAndDestroy() destroys
the placeholder right away when animations are disabled. Connect to the destroy signal
before calling the function.
This fixes the following error:
Gjs-CRITICAL **: 16:51:35.195: Object .Gjs_ui_dash_DragPlaceholderItem (0x55b9a946da20),
has been already disposed — impossible to connect to any signal on it. This might be
caused by the object having been destroyed from C code using something such as destroy(),
dispose(), or remove() vfuncs.
== Stack trace for context 0x55b9a70d08f0 ==
#0 7ffe161bd070 b resource:///org/gnome/shell/ui/dash.js:835 (df3d61d32e0 @ 98)
#1 7ffe161bd170 b resource:///org/gnome/shell/ui/dash.js:901 (df3d61d33d0 @ 779)
#2 7ffe161bd290 b resource:///org/gnome/shell/ui/dnd.js:562 (3d4da0cfd420 @ 909)
#3 7ffe161bd360 b self-hosted:1115 (3d4da0c7ef10 @ 407)
Jakub Steiner [Fri, 6 Jan 2023 16:08:32 +0000 (17:08 +0100)]
data: Update page icons
- The narrow page icons have a 'stretched font' aesthetic about them. Update them to use the
old square-ish glyph.
- Similar style updates happened in Software (banner pager).
Dropping a icon from the dash to the application grid will set this._placeholder
to null. However the AppIcon is still used to represent the application in the
application grid. If we click on it we emit a pressed event. Stop assuming
that this._placeholder is still valid in the callback, use the icon parameter
instead.
This fixes the following error:
```
Gjs-CRITICAL **: 18:22:39.003: JS ERROR: TypeError: this._placeholder is null
_ensurePlaceholder/<@resource:///org/gnome/shell/ui/appDisplay.js:1477:17
vfunc_button_press_event@resource:///org/gnome/shell/ui/appDisplay.js:3121:27
```
sunflowerskater [Fri, 13 Jan 2023 16:09:25 +0000 (13:09 -0300)]
quickSettings: Add a "Power Settings" entry to the Power Profiles submenu
This change adds the shortcut so it can be accessible by devices without a battery and to keep consistency with other submenus like the Wi-Fi submenu and the upcoming Bluetooth submenu (Teams/Design/os-mockups#178).